package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	comment := "Hello, World!"
	basicReader := strings.NewReader(comment)
	fmt.Println("字符串长度:", basicReader.Size())
	reader := bufio.NewReader(basicReader)
	buf := make([]byte, 5)
	n, err := reader.Read(buf)
	if err != nil {
		fmt.Fprintf(os.Stderr, "ERROE: %v\n", err)
	}
	fmt.Printf("Read读取(%d): %q\n", n, buf)
	fmt.Println("缓冲区里的未读字节数：", reader.Buffered())
}
